import request from '@/config/axios'

// 企业积分发放记录 VO
export interface CompanyScoreSendRecordVO {
  id: number // 任务编号
  companyId: number // 企业ID
  employeeId: number // 员工ID
  employeeName: string // 员工名称
  postId: number // 岗位ID
  postName: string // 岗位名称
  score: number // 发放积分
  ruleId: number // 规则ID
  ruleName: string // 规则名称
}

// 企业积分发放记录 API
export const CompanyScoreSendRecordApi = {
  // 查询企业积分发放记录分页
  getCompanyScoreSendRecordPage: async (params: any) => {
    return await request.get({ url: `/dlbz/company-score-send-record/page`, params })
  },

  // 查询企业积分发放记录详情
  getCompanyScoreSendRecord: async (id: number) => {
    return await request.get({ url: `/dlbz/company-score-send-record/get?id=` + id })
  },

  // 新增企业积分发放记录
  createCompanyScoreSendRecord: async (data: CompanyScoreSendRecordVO) => {
    return await request.post({ url: `/dlbz/company-score-send-record/create`, data })
  },

  // 修改企业积分发放记录
  updateCompanyScoreSendRecord: async (data: CompanyScoreSendRecordVO) => {
    return await request.put({ url: `/dlbz/company-score-send-record/update`, data })
  },

  // 删除企业积分发放记录
  deleteCompanyScoreSendRecord: async (id: number) => {
    return await request.delete({ url: `/dlbz/company-score-send-record/delete?id=` + id })
  },

  // 导出企业积分发放记录 Excel
  exportCompanyScoreSendRecord: async (params) => {
    return await request.download({ url: `/dlbz/company-score-send-record/export-excel`, params })
  }
}